<< // Example template for interacting with WebSentinel // Last modified: 8/25/1998 // This simple example uses the functions defined in "sentinel_functions.t" // to communicate with WebSentinel. Specifically, it duplicates the // "Lookup User" feature of WebSentinel Admin but in a web-based interface. // Although this feature is now an option in the WebSentinel 2.0 web-based // administration interface, this example may still be useful for understanding // how WebSentinel scripting works, and can be modified to build other custom // administration applications. // This example only uses a small number of the functions available when // communicating with WebSentinel. See the Scripting folder of the // WebSentinel distribution for a complete list and description. If you // have WebSentinel specific questions, you can also email // . include "sentinel_functions.t"; // There are two possible actions that we can take in this template. // First, if no variables are defined, we present a simple HTML form. // Otherwise, if the "target_id" variable is defined, we know the user // submitted the form and we use sentinel_LookupUser to find the user. // Then, if the user is found, we redirect to the web-based admin of // WebSentinel to modify the user's information. if !defined (target_id) // start off with some HTML for the page << WebSentinel Lookup Example

Target:

Username to lookup:

>> else // find the user user_id = sentinel_LookupUser (user, target_id); // if the user_id is 0, the user didn't exist if user_id = 0 << WebSentinel Lookup Example

Sorry, the user {user} didn't exist. >> else // the user was found, so now redirect to WebSentinel's web-based admin // (note, redirect's really should have the full URL, includding the host name) redirectClient ("/pi_admin.sentinel$modifyuser_form?target_id=" & target_id & "&user_id=" & user_id); end if; end if; >>